Your Coffee Shop Doesn't Use Two-Phase Commit

نویسنده

  • Gregor Hohpe
چکیده

Y ou know you're a geek when going to the coffee shop gets you thinking about interaction patterns between loosely coupled systems. This happened to me on a recent trip to Japan. One of the more familiar sights in Tokyo is the numerous Starbucks coffee shops, especially around Shinjuku and Roppongi. While waiting for my " Hotto Cocoa, " I started thinking about how a coffee shop processes customer orders. As a business, the coffee shop is naturally interested in maximizing order throughput, because more fulfilled orders mean more revenue. Interestingly, the optimization for throughput results in a concurrent and asynchronous processing model: when you place your order, the cashier marks a coffee cup with your order and places it into a queue. This queue is literally a line of coffee cups on top of the espresso machine. The queue decouples the cashier and barista, letting the cashier continue to take orders even when the barista is backed up. It also allows multiple baristas to start servicing the queue if the store gets busy, without impacting the cashier. Asynchronous processing models can be highly efficient but are not without challenges. If the real world writes the best stories, then maybe we can learn something from Starbucks about designing successful asynchronous mes-saging solutions. Correlation For example, the asynchronous processing model means that drink orders aren't necessarily completed in the same sequence in which they were placed. This can happen for two different reasons. First, multiple baristas might be processing orders using different equipment. Blended drinks usually take longer to make than drip coffee , so a drip coffee ordered last might be delivered first. Second, baristas can make multiple drinks in one batch to optimize processing time. As a result, Starbucks has a correlation problem. Drinks are delivered out of sequence and must be matched up with the correct customer. Starbucks solves the problem with the same " pattern " we use in messaging architectures— they use a correlation identifier. 1 In the US, most Starbucks use an explicit correlation identifier by writing your name on the cup and calling it out when the drink is ready. In other countries, they often correlate by drink type. The correlation issue became very apparent in Japan, where I had difficulties understanding the baristas calling out the drinks. My approach was to order extra large " venti " drinks because they're uncommon and therefore …

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Reliability science: reducing the error rate in your practice.

Consider the following scenario: Every day before work, you stop at a neighborhood coffee shop and order a cup of coffee with cream and no sugar. This scenario repeats itself for years without incident. Then one day, after you drive away with your coffee, you notice that the workers forgot the cream and put in sugar instead. The next day you mention the mistake, and the coffee shop manager apol...

متن کامل

A Study on the Cultural Factors Among Ahwaz Coffee-Shop Youth

The purpose of this study is a recognition of cultural effective factors(cultural capital, leisure time , religious attitude) on life style  among Ahwazs coffee-shop youth. The study population included people aged between (15-35) residents in Ahwaz city and the sample size of the research is 400 persons. The method of this study is documentary for conceptual framework and a survey for cultural...

متن کامل

A Two-Phase Constructive Heuristic for Permutation Flow-Shop Scheduling Problem Minimizing Total Completion Time

This paper describes a polynomial-time heuristic for the permutation flow-shop scheduling problem with the criterion of minimizing total completion time. The proposed method consists of two phases: arranging the jobs in priority order and then constructing a sequence. A new ranking method is employed to prioritize the jobs for incorporating into the construction phase of the heuristic. Computat...

متن کامل

2011 SSM Poster Session

1 Sex Differences in Accompaniment and Technology Usage in a Coffee Shop Margaret Diamond, Chloe Kingery, Jessica McAbee, and Jessica Thompson, Department of Psychology Gender differences in accompaniment and technology use were observe in a coffee shop close to a college campus. Young adults (N=232) were observed to see if there was a difference in having accompaniment or sitting along. They w...

متن کامل

A Two-Phase Hybrid Particle Swarm Optimization Algorithm for Solving Permutation Flow-Shop Scheduling Problem

In this paper, a two-phase hybrid particle swarm optimization algorithm (PRHPSO) is proposed for the permutation flow-shop scheduling problem (PFSP) with the minimizing makespan measure. The smallest position value (SPV) rule is used for encoding the particles that enable PSO for suitable PFSP, and the NEH and Tabu search algorithms are used for initializing the particles. In the first phase, t...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • IEEE Software

دوره 22  شماره 

صفحات  -

تاریخ انتشار 2005